package com.project.bookstore.category.mapper;

import com.project.bookstore.category.domain.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bookstore.category.pojo.CategoryIndexDO;
import com.project.bookstore.category.pojo.CategoryRelatedVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author 12603
* @description 针对表【t_category(类别)】的数据库操作Mapper
* @createDate 2022-05-13 13:37:16
* @Entity com.project.bookstore.generete.domain.Category
*/
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    /**
     * 返回主页类别列表信息
     * @return
     */
    List<CategoryIndexDO> listForIndex();

    /**
     * 根据类别 ID 获取其父类ID的所有子ID
     * @return
     */
    List<CategoryRelatedVO> listChildrenByParentId(Long classifyId);

    /**
     * 通过父ID查询子类别ID数组
     * @param parentId
     * @return
     */
    Long[] listIdByParentId(Long parentId);
}




